﻿
using Dapper;
using System.Data;
using System.Linq;
namespace hCommand.oracle {
    internal class SequenceIdServer :AbsSequenceIdServer, ISequenceIdServer {
        public override long querySequence(IDbConnection conn ,IDbTransaction trans) {
            if( conn == null ) {
                return opConn().Query<long>("SELECT  SEQUENCES_ID.NEXTVAL FROM dual").Single();
            } else {
                return conn.Query<long>("SELECT  SEQUENCES_ID.NEXTVAL FROM dual" ,null ,trans).Single();
            }
        }
    }
}
